<template>
  <div>
    <bread>
      <h1>科研概览</h1>
    </bread>
    <page-content isCard>
      <section>
        <el-row :gutter="17">
          <el-col :span="15" class="quick-function">
            <el-card class="box-card">
              <div slot="header">
                <span>快捷功能</span>
              </div>
              <el-row>
                <el-col :span="4" v-for="o in 10" :key="o" :offset="o % 5 == 1 ? 0 : 1" :class="o / 5 > 1 ? 'no-bottom' : ''">
                  <img src="~assets/tools.png" width="54px" height="54px">
                  <span>附件材料生成</span>
                </el-col>
              </el-row>
            </el-card>
          </el-col>
          <el-col :span="9" class="msg-list">
            <el-tabs v-model="activeName" @tab-click="handleClick" type="border-card">
              <el-tab-pane label="学校公告栏" name="first">
                <ul class="">
                  <li v-for="o in 2" :key="o">
                    <p class="msg-title"><span>置顶</span>只是一条置顶公告</p>
                    <p class="msg-content">一点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点点简洁</p>
                    <p class="msg-date">2018-05-09</p>
                  </li>
                </ul>
              </el-tab-pane>
              <el-tab-pane label="待办事项" name="second">待办事项</el-tab-pane>
              <el-tab-pane label="学界资讯" name="third">学界资讯</el-tab-pane>
            </el-tabs>
          </el-col>
        </el-row>
      </section>
      <section class="data-statistics">
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span class="num"><span>项目总数</span><em>745</em></span>
            <span class="num"><span>项目总数</span><em>745</em></span>
            <span class="num"><span>项目总数</span><em>745</em></span>

            <div class="pull-right">
              <el-dropdown trigger="click">
                <span class="el-dropdown-link">
                  下拉菜单<i class="el-icon-arrow-down el-icon--right"></i>
                </span>
                <el-dropdown-menu slot="dropdown">
                  <el-dropdown-item>黄金糕</el-dropdown-item>
                  <el-dropdown-item>狮子头</el-dropdown-item>
                </el-dropdown-menu>
              </el-dropdown>
              <span class="more-option">
                点击展开
                <i class="el-icon-arrow-down"></i>
              </span>
            </div>
          </div>
          <el-row :gutter="17">
            <el-col :span="3" v-for="o in 8" :key="o">
              <div class="achievement-header">
                纵向课题
              </div>
              <div class="achievement-content">
                <p>1533</p>
                <p>￥：3245万</p>
              </div>
            </el-col>
          </el-row>
        </el-card>
      </section>
      <section>
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span>各学院科研数据量对比分析</span>
            <div class="pull-right">
              <el-dropdown trigger="click">
                <span class="el-dropdown-link">
                  下拉菜单<i class="el-icon-arrow-down el-icon--right"></i>
                </span>
                <el-dropdown-menu slot="dropdown">
                  <el-dropdown-item>黄金糕</el-dropdown-item>
                  <el-dropdown-item>狮子头</el-dropdown-item>
                </el-dropdown-menu>
              </el-dropdown>
              <span class="more-option">
                查看全部
                <i class="el-icon-arrow-right"></i>
              </span>
            </div>
          </div>
          <el-table
            :data="tableData"
            stripe
            border
            style="width: 100%">
            <el-table-column
              prop="date"
              label="日期"
              width="180">
            </el-table-column>
            <el-table-column
              prop="name"
              label="姓名"
              width="180">
            </el-table-column>
            <el-table-column
              prop="address"
              label="地址">
            </el-table-column>
          </el-table>
        </el-card>
      </section>
      <section>
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span>各学院科研数据量对比分析</span>
            <div class="pull-right">
              <el-dropdown trigger="click">
                <span class="el-dropdown-link">
                  下拉菜单<i class="el-icon-arrow-down el-icon--right"></i>
                </span>
                <el-dropdown-menu slot="dropdown">
                  <el-dropdown-item>黄金糕</el-dropdown-item>
                  <el-dropdown-item>狮子头</el-dropdown-item>
                </el-dropdown-menu>
              </el-dropdown>
              <span class="more-option">
                查看全部
                <i class="el-icon-arrow-right"></i>
              </span>
            </div>
          </div>
          <el-table
            :data="tableData"
            stripe
            border
            style="width: 100%">
            <el-table-column
              prop="date"
              label="日期"
              width="180">
            </el-table-column>
            <el-table-column
              prop="name"
              label="姓名"
              width="180">
            </el-table-column>
            <el-table-column
              prop="address"
              label="地址">
            </el-table-column>
          </el-table>
        </el-card>
      </section>
      <section>
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span>全校科研数据年度趋势图</span>
            <div class="pull-right">
              <el-dropdown trigger="click">
                <span class="el-dropdown-link">
                  时间：历史总立项<i class="el-icon-arrow-down el-icon--right"></i>
                </span>
                <el-dropdown-menu slot="dropdown">
                  <el-dropdown-item>黄金糕</el-dropdown-item>
                  <el-dropdown-item>狮子头</el-dropdown-item>
                </el-dropdown-menu>
              </el-dropdown>
            </div>
          </div>
          <div id="trend-chart">
          </div>
        </el-card>
      </section>
      <section class="achievement-rank">
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span>全校人个成果量排行榜</span>
            <div class="pull-right">
              <el-dropdown trigger="click">
                <span class="el-dropdown-link">
                  下拉菜单<i class="el-icon-arrow-down el-icon--right"></i>
                </span>
                <el-dropdown-menu slot="dropdown">
                  <el-dropdown-item>黄金糕</el-dropdown-item>
                  <el-dropdown-item>狮子头</el-dropdown-item>
                </el-dropdown-menu>
              </el-dropdown>
              <span class="more-option">
                查看全部
                <i class="el-icon-arrow-right"></i>
              </span>
            </div>
          </div>
          <el-row :gutter="26">
            <el-col v-for="o in 4" :key="o" :span="6">
              <el-card class="box-card">
                <div slot="header" class="achievement-title">
                  <span>总发文量TOP5</span>
                </div>
                <ul>
                  <li v-for="o in 5" :key="o">
                    1
                    <img src="~assets/tools.png">
                    <b>李云生</b>
                    <small>574份</small>
                  </li>
                </ul>
              </el-card>
            </el-col>
          </el-row>
        </el-card>
      </section>
    </page-content>
  </div>
</template>

<script>
import echartsOption from './echartsOption';
import { mapState } from 'vuex'
export default {
  name: 'hello',
  data () {
    return {
      activeName: 'first',
      tableData: [{
        date: '2016-05-02',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-04',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1517 弄'
      }, {
        date: '2016-05-01',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1519 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }],
      trendChart: null,
      localCount: 10
    }
  },
  mounted () {
    require.ensure([], (require) => {
      const echarts = require('echarts');
      this.trendChart = echarts.init(document.getElementById('trend-chart'));
      this.trendChart.setOption(echartsOption);
    });
  },
  methods: {
    handleClick(tab, event) {
      console.log(tab, event);
    }
  }
};
</script>
<style scoped lang="scss">
// 公共
section {
  margin-bottom: 33px;
  .el-card__header {
    height: 50px;
    padding: 13px 20px;
  }
}
li {
  list-style: none;
}
#trend-chart {
  height: 450px;
}
.more-option {
  font-size: 14px;
  margin-left: 26px;
}
// 快捷功能
.quick-function {
  .el-col {
    display: flex;
    align-items: center;
    flex-direction: column;
    font-size: 14px;
    margin-bottom: 29px;
    img {
      margin-bottom: 13px;
    }
  }
  .no-bottom {
    margin-bottom: 0;
  }
}
// 公告栏
.msg-list {
  li {
    padding: 1px 6px;
    font-size: 14px;
    line-height: 18px;
    margin-bottom: 20px;
  }
  .msg-title {
    color: #333;
  }
  .msg-content {
    color: rgba(0, 0, 0, .45);
  }
  .msg-date {
    color: rgba(51,51,51,0.45);
    font-size: 12px;
    margin-top: 10px;
  }
}

// 成果统计
.data-statistics {
  .num {
    span {
      vertical-align: middle;
    }
  }
  em {
     font-size: 20px;
     color: #324057;
     margin: 0 40px 0 10px;
     font-style: normal;
     vertical-align: middle;
  }
  .achievement-header {
    padding: 5px 10px;
    background-color: orange;
    border-radius: 4px 4px 0 0;
    color: #fff;
  }
  .achievement-content {
      text-align: center;
      padding: 5px;
      background-color: orange;
      border-top: 1px solid #fff;
      color: #fff;
      border-radius: 0 0 4px 4px;
  }
}
// 成果量排行榜
.achievement-rank {
  li {
    padding: 15px 0;
    display: flex;
    align-items: center;
    justify-content: space-around;
  }
  img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin: 0 14px 0 20px;
    vertical-align: middle;
  }
  small {
    flex: 1;
    text-align: right;
  }
  .achievement-title {
    text-align: center;
    font-size: 21px;
    color: orange;
    padding: 0;
  }
}
</style>
<style lang="scss">
.msg-list {
  .el-tabs__header {
    background: none;
    border: none;
  }
  .el-tabs--border-card > .el-tabs__header {
    .el-tabs__item {
      padding: 0;
      margin: 0 20px;
      border: none;
      height: 50px;
      line-height: 50px;
      &:hover {
        color: rgba(0, 0, 0, .75);
      }
      &.is-active {
        color: rgba(0, 0, 0, .75);
        font-size: 16px;
        border: none;
        border-bottom: 2px solid #00B38A;
      }
    }
  }
}
</style>
